import request from '@/utils/request'

export function login(data) {
  // return request({
  //   url: '/vue-element-admin/user/login',
  //   method: 'post',
  //   data
  // })
  return Promise.resolve({
    code: 20000,
    data: 'admin-token'
  })
}

export function getInfo(token) {
  // return request({
  //   url: '/vue-element-admin/user/info',
  //   method: 'get',
  //   params: { token }
  // })
  return Promise.resolve({
    code: 20000,
    data: {
      roles: ['admin'],
      introduction: 'I am a super administrator',
      avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
      name: 'Super Admin'
    }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
  // return Promise.resolve({});
}

export function getlist() {
  return request({
    url: '/voc-getlist',
    method: 'get'
  })
}

export function getone(id) {
  return request({
    url: '/voc-getone',
    method: 'get',
    params: { id }
  })
}

export function judge(url) {
  return request({
    url: '/voc-judge',
    method: 'get',
    params: { curl: url }
  })
}

export function getonecomment(id, pagenum) {
  return request({
    url: '/voc-getonecomment',
    method: 'get',
    params: { id, pagenum }
  })
}
